package com.applet.mallappletbackstage.config;

import com.applet.mallappletbackstage.handler.filter.LoginFilter;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.Arrays;
import java.util.Collections;

@Configuration
public class FilterConfig {
    @Bean
    public FilterRegistrationBean<LoginFilter> loginFilterFilterRegistrationBean() {
        LoginFilter loginFilter = new LoginFilter();
        FilterRegistrationBean<LoginFilter> loginFilterFilterRegistrationBean = new FilterRegistrationBean<>();
        loginFilterFilterRegistrationBean.setFilter(loginFilter);
        loginFilterFilterRegistrationBean.setUrlPatterns(Collections.singletonList("/release-work/admin/*"));
        return loginFilterFilterRegistrationBean;
    }
}
